package com.wngbms;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Arrays;
import java.util.Optional;

public class CreateSeqDemo {

    public static void main(String[] args) {

        Flux.just("123");
        Mono.just("123");

        Mono.justOrEmpty("6666");
        Mono.justOrEmpty(Optional.of("1234"));

        Mono.fromSupplier(() -> "123");

        Flux.just("1", "2");
        Flux.fromArray(new String[]{"1", "2"});
        Flux.fromIterable(Arrays.asList("1", "2"));
        Flux.range(1, 5);
        Flux.fromStream(Arrays.stream(new String[]{"1", "2"}));

        Mono.fromSupplier(() -> 234L);
        Mono.fromRunnable(() -> {});
        Mono.fromCallable(() -> 234L);

        Flux.empty();
        Mono.empty();

        Flux.error(new RuntimeException(""));
        Mono.error(new RuntimeException(""));

        Flux.error(() -> new RuntimeException(""));
        Mono.error(() -> new RuntimeException(""));

        Flux.never();
        Mono.never();

        Flux.generate(v -> {

        });

        Flux.create(v -> {

        });

        Mono.create(v -> {

        });
    }

}
